package ${package.ServiceImpl};

import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
import ${superServiceImplClassPackage};
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;

/**
* <p>
    * ${table.comment!} 服务实现类
    * </p>
*
* @author ${author}
* @since ${date}
*/
@Service
<#if kotlin>
    open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {

    }
<#else>
    public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} {

<#-- 获取主键字段信息 -->
    <#assign keyField = table.fields[0]>
    <#list table.fields as field>
        <#if field.keyFlag>
            <#assign keyField = field>
            <#break>
        </#if>
    </#list>

    @Autowired
    private ${table.mapperName} ${table.entityPath}Mapper;

    @Override
    public IPage<${entity}> pageWithCondition(Page<${entity}> page, QueryWrapper<${entity}> queryWrapper) {
    return this.page(page, queryWrapper);
    }

    }
</#if>